package com.deer.wms.inventory.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.deer.wms.inventory.model.Inventory.Inventory;
import com.deer.wms.inventory.model.Inventory.InventoryTransact;
import com.deer.wms.inventory.model.Inventory.InventoryTransactCriteria;
import com.deer.wms.inventory.model.Inventory.InventoryTransactDto;

import java.util.List;
import java.util.Map;


/**
 * Created by 郭靖勋 on 2019/12/18.
 */
public interface InventoryTransactService extends IService<InventoryTransact> {

    List<InventoryTransactDto> findList(InventoryTransactCriteria criteria);

    /**
     * 事务提交，修改库存
     * @param inventoryTransact 库存事务
     * @return int
     */
    int run(InventoryTransact inventoryTransact);

    /**
     *
     * @param fromInventory
     * @param toInventory
     * @param transactType
     * @param detailNo
     * @param createUserId
     * @param createUserName
     * @param relateId
     * @return
     */
    Map run (Inventory fromInventory, Inventory toInventory, Integer transactType, String detailNo, Integer createUserId, String createUserName, Integer relateId);


    /**
     * 分页总数
     * @param criteria
     * @return
     */
    long findCount(InventoryTransactCriteria criteria);
}
